package com.example.controller;

import com.example.dto.CalendarRequestDto;
import com.example.dto.CalendarResponseDto;
import com.example.service.CalendarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/calendar")
public class CalendarController {
    @Autowired
    private CalendarService calendarService;

    /**
     * 返回日期与预约人数
     * @param requestDto
     * @return
     */
    @PostMapping("/list")
    public List<CalendarResponseDto> getAppointmentCalendar(@RequestBody CalendarRequestDto requestDto) {
        return calendarService.listAppointmentCalendar(requestDto);
    }

}
